import {request} from "@/network/request";

//修改文章的首页显示与否
export function updateCaseStatus(id){
  return request({
    url:'/api/admin/updateCaseStatus',
    method:'get',
    params:{
      id
    }
  })
}

//删除成功案例
export function deleteCase(id){
  return request({
    url:'/api/admin/deleteCase',
    method:'get',
    params:{
      id
    }
  })
}

//添加成功案例
export function addCase(article){
  return request({
    url:'/api/admin/addCase',
    method:'post',
    data:article
  })
}

//修改成功案例
export function updateCase(article){
  return request({
    url:'/api/admin/updateCase',
    method:'post',
    data: article
  })
}

//获取所有成功案例
export function getAllCase(){
  return request({
    url:'/api/admin/getAllCase',
  })
}

//根据条件查询成功案例
export function getCaseByKey(search){
  return request({
    url:'/api/admin/getCaseByKey',
    method: 'post',
    data:{
      case_id: search.case_id ? parseInt(search.case_id):'',
      case_title: search.case_title,
      case_content: search.case_content,
      case_status: search.case_status
    }
  })
}
